/*
 * xxxJuridica.java
 *
 * Created on 13/06/2009, 08:44:39
 * Copyright Guilherme
 */
package Soligee.view;

import Soligee.controller.facade.sessionFacadeImplements.SessionFacadeBuscarImplements;
import Soligee.controller.facade.sessionFacadeImplements.SessionFacadeCadastrarImplements;
import Soligee.decorador.DecoradorInicializaCombos;
import Soligee.decorador.ValidaCamposObrigatorios;
import Soligee.model.vo.cadastros.PessoaJuridicaVO;
import Soligee.view.ApplicationBean1;
import com.icesoft.faces.component.ext.HtmlCommandButton;
import com.icesoft.faces.component.ext.HtmlCommandLink;
import com.icesoft.faces.component.ext.HtmlInputText;
import com.icesoft.faces.component.ext.HtmlOutputLabel;
import com.icesoft.faces.component.ext.HtmlOutputText;
import com.icesoft.faces.component.ext.HtmlSelectOneMenu;
import com.icesoft.faces.component.ext.HtmlSelectOneRadio;
import com.icesoft.faces.component.jsfcl.data.DefaultSelectedData;
import com.icesoft.faces.component.jsfcl.data.DefaultSelectionItems;
import com.icesoft.faces.component.jsfcl.data.PopupBean;
import com.icesoft.faces.component.jsfcl.data.SelectInputDateBean;
import com.icesoft.faces.component.panelpopup.PanelPopup;
import com.icesoft.faces.component.paneltabset.PanelTab;
import com.icesoft.faces.component.paneltabset.PanelTabSet;
import com.icesoft.faces.component.selectinputdate.SelectInputDate;
import com.sun.rave.faces.converter.SqlDateConverter;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import java.util.Date;
import java.util.List;
import javax.faces.FacesException;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;

public class CadastrarPessoaJuridica extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    private int __placeholder;
    private int controle =0;
    private ValidaCamposObrigatorios valida = new ValidaCamposObrigatorios();

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }

    //Tipo Endereço
    private DefaultSelectedData botaoSelecionadoTipoEndereco = new DefaultSelectedData();

    public DefaultSelectedData getBotaoSelecionadoTipoEndereco() {
        return botaoSelecionadoTipoEndereco;
    }

    public void setBotaoSelecionadoTipoEndereco(DefaultSelectedData dsd) {
        this.botaoSelecionadoTipoEndereco = dsd;
    }
    private DefaultSelectionItems botaoTipoEndereco = new DefaultSelectionItems();

    public DefaultSelectionItems getBotaoTipoEndereco() {
        return botaoTipoEndereco;
    }

    public void setBotaoTipoEndereco(DefaultSelectionItems dsi) {
        this.botaoTipoEndereco = dsi;
    }
    //Fim-Tipo Endereço

    //UF
    private DefaultSelectedData botaoSelecionadoUf = new DefaultSelectedData();

    public DefaultSelectedData getBotaoSelecionadoUf() {
        return botaoSelecionadoUf;
    }

    public void setBotaoSelecionadoUf(DefaultSelectedData dsd) {
        this.botaoSelecionadoUf = dsd;
    }
    private DefaultSelectionItems botaoUf = new DefaultSelectionItems();

    public DefaultSelectionItems getBotaoUf() {
        return botaoUf;
    }

    public void setBotaoUf(DefaultSelectionItems dsi) {
        this.botaoUf = dsi;
    }
    private SelectInputDateBean selectInputDate1Bean = new SelectInputDateBean();

    public SelectInputDateBean getSelectInputDate1Bean() {
        return selectInputDate1Bean;
    }

    public void setSelectInputDate1Bean(SelectInputDateBean sidb) {
        this.selectInputDate1Bean = sidb;
    }
    private HtmlInputText campoNomeCompleto = new HtmlInputText();

    public HtmlInputText getCampoNomeCompleto() {
        return campoNomeCompleto;
    }

    public void setCampoNomeCompleto(HtmlInputText hit) {
        this.campoNomeCompleto = hit;
    }
    private HtmlInputText campoPaginaWeb = new HtmlInputText();

    public HtmlInputText getCampoPaginaWeb() {
        return campoPaginaWeb;
    }

    public void setCampoPaginaWeb(HtmlInputText hit) {
        this.campoPaginaWeb = hit;
    }
    private HtmlInputText campoRazaoSocial = new HtmlInputText();

    public HtmlInputText getCampoRazaoSocial() {
        return campoRazaoSocial;
    }

    public void setCampoRazaoSocial(HtmlInputText hit) {
        this.campoRazaoSocial = hit;
    }
    private HtmlInputText campoIncricaoEstadual = new HtmlInputText();

    public HtmlInputText getCampoIncricaoEstadual() {
        return campoIncricaoEstadual;
    }

    public void setCampoIncricaoEstadual(HtmlInputText hit) {
        this.campoIncricaoEstadual = hit;
    }
    private HtmlInputText campoCnpj = new HtmlInputText();

    public HtmlInputText getCampoCnpj() {
        return campoCnpj;
    }

    public void setCampoCnpj(HtmlInputText hit) {
        this.campoCnpj = hit;
    }
    private HtmlInputText campoEmail = new HtmlInputText();

    public HtmlInputText getCampoEmail() {
        return campoEmail;
    }

    public void setCampoEmail(HtmlInputText hit) {
        this.campoEmail = hit;
    }
    private SelectInputDate campoDataCadastro = new SelectInputDate();

    public SelectInputDate getCampoDataCadastro() {
        return campoDataCadastro;
    }

    public void setCampoDataCadastro(SelectInputDate sid) {
        this.campoDataCadastro = sid;
    }
    private HtmlInputText campoRua = new HtmlInputText();

    public HtmlInputText getCampoRua() {
        return campoRua;
    }

    public void setCampoRua(HtmlInputText hit) {
        this.campoRua = hit;
    }
    private HtmlInputText campoNumero = new HtmlInputText();

    public HtmlInputText getCampoNumero() {
        return campoNumero;
    }

    public void setCampoNumero(HtmlInputText hit) {
        this.campoNumero = hit;
    }
    private HtmlInputText campoComplemento = new HtmlInputText();

    public HtmlInputText getCampoComplemento() {
        return campoComplemento;
    }

    public void setCampoComplemento(HtmlInputText hit) {
        this.campoComplemento = hit;
    }
    private HtmlInputText campoBairro = new HtmlInputText();

    public HtmlInputText getCampoBairro() {
        return campoBairro;
    }

    public void setCampoBairro(HtmlInputText hit) {
        this.campoBairro = hit;
    }
    private HtmlInputText campoCep = new HtmlInputText();

    public HtmlInputText getCampoCep() {
        return campoCep;
    }

    public void setCampoCep(HtmlInputText hit) {
        this.campoCep = hit;
    }
    private HtmlSelectOneMenu ufPessoaFisica = new HtmlSelectOneMenu();

    public HtmlSelectOneMenu getUfPessoaFisica() {
        return ufPessoaFisica;
    }

    public void setUfPessoaFisica(HtmlSelectOneMenu hsom) {
        this.ufPessoaFisica = hsom;
    }
    private HtmlCommandButton btn_cadastrar = new HtmlCommandButton();

    public HtmlCommandButton getBtn_cadastrar() {
        return btn_cadastrar;
    }

    public void setBtn_cadastrar(HtmlCommandButton hcb) {
        this.btn_cadastrar = hcb;
    }
    private PanelTabSet panelTabSetCadastrarPessoaJuridica = new PanelTabSet();

    public PanelTabSet getPanelTabSetCadastrarPessoaJuridica() {
        return panelTabSetCadastrarPessoaJuridica;
    }

    public void setPanelTabSetCadastrarPessoaJuridica(PanelTabSet pts) {
        this.panelTabSetCadastrarPessoaJuridica = pts;
    }
    private HtmlInputText campoTelefoneComercial = new HtmlInputText();

    public HtmlInputText getCampoTelefoneComercial() {
        return campoTelefoneComercial;
    }

    public void setCampoTelefoneComercial(HtmlInputText hit) {
        this.campoTelefoneComercial = hit;
    }
    private HtmlInputText campoFax = new HtmlInputText();

    public HtmlInputText getCampoFax() {
        return campoFax;
    }

    public void setCampoFax(HtmlInputText hit) {
        this.campoFax = hit;
    }
    private PopupBean panelPopup1Bean = new PopupBean();

    public PopupBean getPanelPopup1Bean() {
        return panelPopup1Bean;
    }

    public void setPanelPopup1Bean(PopupBean pb) {
        this.panelPopup1Bean = pb;
    }
    private PanelPopup panelPopup = new PanelPopup();

    public PanelPopup getPanelPopup() {
        return panelPopup;
    }

    public void setPanelPopup(PanelPopup pp) {
        this.panelPopup = pp;
    }
    private HtmlOutputText textoPopUp = new HtmlOutputText();

    public HtmlOutputText getTextoPopUp() {
        return textoPopUp;
    }

    public void setTextoPopUp(HtmlOutputText hot) {
        this.textoPopUp = hot;
    }
    private HtmlCommandButton btnPopUp1 = new HtmlCommandButton();

    public HtmlCommandButton getBtnPopUp1() {
        return btnPopUp1;
    }

    public void setBtnPopUp1(HtmlCommandButton hcb) {
        this.btnPopUp1 = hcb;
    }
    private HtmlCommandButton btnPopUp2 = new HtmlCommandButton();

    public HtmlCommandButton getBtnPopUp2() {
        return btnPopUp2;
    }

    public void setBtnPopUp2(HtmlCommandButton hcb) {
        this.btnPopUp2 = hcb;
    }
    private HtmlInputText campoCodCliente = new HtmlInputText();

    public HtmlInputText getCampoCodCliente() {
        return campoCodCliente;
    }

    public void setCampoCodCliente(HtmlInputText hit) {
        this.campoCodCliente = hit;
    }
    private HtmlCommandLink tx_opCancelarAba02 = new HtmlCommandLink();

    public HtmlCommandLink getTx_opCancelarAba02() {
        return tx_opCancelarAba02;
    }

    public void setTx_opCancelarAba02(HtmlCommandLink hcl) {
        this.tx_opCancelarAba02 = hcl;
    }
    private HtmlCommandLink tx_opCancelarAba01 = new HtmlCommandLink();

    public HtmlCommandLink getTx_opCancelarAba01() {
        return tx_opCancelarAba01;
    }

    public void setTx_opCancelarAba01(HtmlCommandLink hcl) {
        this.tx_opCancelarAba01 = hcl;
    }
    private HtmlCommandLink link_proximoPassoAba01 = new HtmlCommandLink();

    public HtmlCommandLink getLink_proximoPassoAba01() {
        return link_proximoPassoAba01;
    }

    public void setLink_proximoPassoAba01(HtmlCommandLink hcl) {
        this.link_proximoPassoAba01 = hcl;
    }
    private DefaultSelectedData selectOneMenu1Bean = new DefaultSelectedData();

    public DefaultSelectedData getSelectOneMenu1Bean() {
        return selectOneMenu1Bean;
    }

    public void setSelectOneMenu1Bean(DefaultSelectedData dsd) {
        this.selectOneMenu1Bean = dsd;
    }
    private DefaultSelectionItems selectOneMenu1DefaultItems = new DefaultSelectionItems();

    public DefaultSelectionItems getSelectOneMenu1DefaultItems() {
        return selectOneMenu1DefaultItems;
    }

    public void setSelectOneMenu1DefaultItems(DefaultSelectionItems dsi) {
        this.selectOneMenu1DefaultItems = dsi;
    }
    private HtmlSelectOneMenu campoCidade = new HtmlSelectOneMenu();

    public HtmlSelectOneMenu getCampoCidade() {
        return campoCidade;
    }

    public void setCampoCidade(HtmlSelectOneMenu hsom) {
        this.campoCidade = hsom;
    }
    private DefaultSelectedData selectOneRadio1Bean = new DefaultSelectedData();

    public DefaultSelectedData getSelectOneRadio1Bean() {
        return selectOneRadio1Bean;
    }

    public void setSelectOneRadio1Bean(DefaultSelectedData dsd) {
        this.selectOneRadio1Bean = dsd;
    }
    private DefaultSelectionItems selectOneRadio1DefaultItems = new DefaultSelectionItems();

    public DefaultSelectionItems getSelectOneRadio1DefaultItems() {
        return selectOneRadio1DefaultItems;
    }

    public void setSelectOneRadio1DefaultItems(DefaultSelectionItems dsi) {
        this.selectOneRadio1DefaultItems = dsi;
    }
    private HtmlSelectOneRadio tipoEndereco = new HtmlSelectOneRadio();

    public HtmlSelectOneRadio getTipoEndereco() {
        return tipoEndereco;
    }

    public void setTipoEndereco(HtmlSelectOneRadio hsor) {
        this.tipoEndereco = hsor;
    }
    private HtmlOutputLabel txTipoEndereco = new HtmlOutputLabel();

    public HtmlOutputLabel getTxTipoEndereco() {
        return txTipoEndereco;
    }

    public void setTxTipoEndereco(HtmlOutputLabel hol) {
        this.txTipoEndereco = hol;
    }
    private SqlDateConverter sqlDateConverter1 = new SqlDateConverter();

    public SqlDateConverter getSqlDateConverter1() {
        return sqlDateConverter1;
    }

    public void setSqlDateConverter1(SqlDateConverter sdc) {
        this.sqlDateConverter1 = sdc;
    }
    private PanelTab aba01 = new PanelTab();

    public PanelTab getAba01() {
        return aba01;
    }

    public void setAba01(PanelTab pt) {
        this.aba01 = pt;
    }
    private PanelTab aba02 = new PanelTab();

    public PanelTab getAba02() {
        return aba02;
    }

    public void setAba02(PanelTab pt) {
        this.aba02 = pt;
    }
    private HtmlOutputLabel tx_codigo = new HtmlOutputLabel();

    public HtmlOutputLabel getTx_codigo() {
        return tx_codigo;
    }

    public void setTx_codigo(HtmlOutputLabel hol) {
        this.tx_codigo = hol;
    }

    //Fim-UF

    // </editor-fold>
    public CadastrarPessoaJuridica() {
    }

    @Override
    public void init() {
        super.init();
        this.inicializarCampos();
        this.limparCampos();
        panelTabSetCadastrarPessoaJuridica.setSelectedIndex(0);

        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("xxxJuridica Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e : new FacesException(e);
        }

    // </editor-fold>

    }

    @Override
    public void preprocess() {
    }

    @Override
    public void prerender() {
    }

    @Override
    public void destroy() {
    }

    protected RequestBean1 getview$RequestBean1() {
        return (RequestBean1) getBean("view$RequestBean1");
    }

    protected SessionBean1 getview$SessionBean1() {
        return (SessionBean1) getBean("view$SessionBean1");
    }

    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }

    protected CadastrarPessoaFisica getview$CadastrarPessoaFisica() {
        return (CadastrarPessoaFisica) getBean("view$CadastrarPessoaFisica");
    }

    protected BuscarPessoaFisica getview$BuscarPessoaFisica() {
        return (BuscarPessoaFisica) getBean("view$BuscarPessoaFisica");
    }

    protected ApplicationBean1 getview$ApplicationBean1() {
        return (ApplicationBean1) getBean("view$ApplicationBean1");
    }

    protected BuscarRepresentante getview$BuscarRepresentante() {
        return (BuscarRepresentante) getBean("view$BuscarRepresentante");
    }

    protected CadastrarVendedor getview$CadastrarVendedor() {
        return (CadastrarVendedor) getBean("view$CadastrarVendedor");
    }

    public String link_proximoPassoAba01_action() {
        

        valida.verificaCampoVazio(campoNomeCompleto);
        valida.verificaCampoVazio(campoCnpj);
        valida.verificaCampoVazio(campoRazaoSocial);
        valida.verificaCampoVazio(campoIncricaoEstadual);
        
        aba01.setDisabled(true);
        aba02.setDisabled(false);
        panelTabSetCadastrarPessoaJuridica.setSelectedIndex(1);
        campoRua.requestFocus();
        
        return null;
    }

    public String btn_cadastrar_action() {

        valida.verificaCampoVazio(campoRua);
        valida.verificaCampoVazio(campoNumero);
        valida.verificaCampoVazio(campoBairro);
        valida.verificaCampoVazio(campoCep);

        if(valida.verificaCampoVazio(campoNomeCompleto)||valida.verificaCampoVazio(campoCnpj)||valida.verificaCampoVazio(campoRazaoSocial)||valida.verificaCampoVazio(campoIncricaoEstadual))
        {
            aba01.setDisabled(false);
            aba02.setDisabled(true);
            panelTabSetCadastrarPessoaJuridica.setSelectedIndex(0);
            controlaPopup(true,"Campos Obrigatório!",false,true,"","Ok");
        }
        else if(valida.verificaCampoVazio(campoRua)||valida.verificaCampoVazio(campoNumero)||valida.verificaCampoVazio(campoBairro)||valida.verificaCampoVazio(campoCep))
            controlaPopup(true,"Campos Obrigatório!",false,true,"","Ok");
        else
            controlaPopup(true,"Deseja cadastar o Cliente Jurídico?",true,true,"Sim","Não");
       return null;
    }
    
    public String btnPopUp1_action() {   
    if(controle==0){
        Date dataCadastro = (Date) (Object) campoDataCadastro.getValue();
        SessionFacadeCadastrarImplements facadeCadastrar = new SessionFacadeCadastrarImplements();
    try{

        if(facadeCadastrar.cadastrarPessoaJurididca(Integer.parseInt(campoCodCliente.getValue().toString()), campoNomeCompleto.getValue().toString(), campoTelefoneComercial.getValue().toString(),
        campoFax.getValue().toString() , campoEmail.getValue().toString(), campoPaginaWeb.getValue().toString(), "",
        dataCadastro, campoRazaoSocial.getValue().toString(), campoCnpj.getValue().toString(), campoIncricaoEstadual.getValue().toString(),
        //parametros Endereco
        1,Integer.parseInt(tipoEndereco.getValue().toString()), campoRua.getValue().toString(), campoBairro.getValue().toString(),campoCep.getValue().toString(),campoNumero.getValue().toString(),campoComplemento.getValue().toString(),
         Integer.parseInt(campoCidade.getValue().toString()) )){

        controlaPopup (true,"Pessoa Juridica Cadastrada com Sucesso!",false,true,"","OK");
        limparCampos();
        panelTabSetCadastrarPessoaJuridica.setSelectedIndex(0);
      }
     } catch(Exception e){
        controlaPopup (true,"Erro:"+e.getMessage()+"caused by: "+e.getStackTrace(),false,true,"","OK");
        System.err.println("Erro:"+e.getMessage()+"caused by: "+e.getStackTrace());
      }
      return null;
    }
    else
            if(controle == 1){
                panelPopup.setRendered(false);
                return "voltar";
            }
       return null;

        }

    public String btnPopUp2_action() {
        panelPopup.setRendered(false);
        return null;
    }

    public void controlaPopup(boolean renderedPopup,String textoPoup,boolean btn1Rendered, boolean btn2Rendered,
            String textobtn1, String textobtn2){
        
        panelPopup.setRendered(renderedPopup);
        textoPopUp.setValue(textoPoup);
        btnPopUp1.setValue(textobtn1);
        btnPopUp1.setRendered(btn1Rendered);
        btnPopUp2.setRendered(btn2Rendered);
        btnPopUp2.setValue(textobtn2);
    }

    public void tx_opCancelarAba_action() {
        this.limparCampos();
        this.inicializarCampos();
        aba01.setDisabled(false);
        panelTabSetCadastrarPessoaJuridica.setSelectedIndex(0);
    }

    public void limparCampos() {
        campoDataCadastro.resetValue();       
        campoNomeCompleto.resetValue();
        campoTelefoneComercial.resetValue();
        campoFax.resetValue();
        campoEmail.resetValue();
        campoPaginaWeb.resetValue();
        campoRazaoSocial.resetValue();
        campoCnpj.resetValue();
        campoIncricaoEstadual.resetValue();
        campoRua.resetValue();
        campoBairro.resetValue();
        campoCep.resetValue();
        campoNumero.resetValue();
        campoComplemento.resetValue();
        campoBairro.setMaxlength(50);
        
        
    }

    public void inicializarCampos() {
        campoRazaoSocial.setMaxlength(50);
        campoNomeCompleto.setMaxlength(100);
        campoIncricaoEstadual.setMaxlength(20);
        campoEmail.setMaxlength(50);
        campoPaginaWeb.setMaxlength(50);
        campoRua.setMaxlength(50);
        campoNumero.setMaxlength(10);        
        //inicializao de campo de codigo de Pessoa Juridica
      try {
        SessionFacadeBuscarImplements facadeBusca = new SessionFacadeBuscarImplements();
        List<PessoaJuridicaVO> listaPessoas = facadeBusca.buscarTodos("codPessoa", PessoaJuridicaVO.class);
        int tamanholista = listaPessoas.size();
        PessoaJuridicaVO pessoa;
        pessoa = listaPessoas.get(tamanholista-1);
        int proximocodigo = pessoa.getCodPessoa()+1;

        campoCodCliente.setValue(proximocodigo);
      } catch (Exception e) {
         System.err.println(e.getMessage());
      }
        campoCodCliente.setReadonly(true);
        txTipoEndereco.setRendered(false);
        tipoEndereco.setRendered(false);
        //UF
        botaoUf.clear();
        botaoUf.add(new SelectItem(1,"AC"));
        botaoUf.add(new SelectItem(2,"AL"));
        botaoUf.add(new SelectItem(3,"AP"));
        botaoUf.add(new SelectItem(4,"AM"));
        botaoUf.add(new SelectItem(5,"BA"));
        botaoUf.add(new SelectItem(6,"CE"));
        botaoUf.add(new SelectItem(7,"DF"));
        botaoUf.add(new SelectItem(8,"ES"));
        botaoUf.add(new SelectItem(9,"GO"));
        botaoUf.add(new SelectItem(10,"MA"));
        botaoUf.add(new SelectItem(11,"MT"));
        botaoUf.add(new SelectItem(12,"MS"));
        botaoUf.add(new SelectItem(13,"MG"));
        botaoUf.add(new SelectItem(14,"PA"));
        botaoUf.add(new SelectItem(15,"PB"));
        botaoUf.add(new SelectItem(16,"PR"));
        botaoUf.add(new SelectItem(17,"PE"));
        botaoUf.add(new SelectItem(18,"PI"));
        botaoUf.add(new SelectItem(19,"RJ"));
        botaoUf.add(new SelectItem(20,"RN"));
        botaoUf.add(new SelectItem(21,"RS"));
        botaoUf.add(new SelectItem(22,"RO"));
        botaoUf.add(new SelectItem(23,"RR"));
        botaoUf.add(new SelectItem(24,"SC"));
        botaoUf.add(new SelectItem(25,"SP"));
        botaoUf.add(new SelectItem(26,"SE"));
        botaoUf.add(new SelectItem(27,"TO"));

        InicializaCampoCidade(16);
        ufPessoaFisica.setValue(16);
        campoCidade.setValue(2788);
        
        controlaPopup(false,"?",false,false,"","");

        selectOneRadio1DefaultItems.clear();
        selectOneRadio1DefaultItems.add(new SelectItem(1,"Residencial"));
        selectOneRadio1DefaultItems.add(new SelectItem(1,"Comercial"));

        tipoEndereco.setValue(new Integer(1));

        //inicializarAbas
        aba02.setDisabled(true);
        
        }

    public String btn_voltar_action() {
        controle = 1;
        controlaPopup(true,"Deseja Sair ?",true,true,"Sim","Não");
        System.out.println(controle);
        return null;
    }

        //metodo para preenchimento do combobox fornecedor
       public void InicializaCampoCidade(int codEstado){
           this.setSelectOneMenu1DefaultItems(new DecoradorInicializaCombos().inicializaCampoCidade(codEstado));
      }

    public void ufPessoaFisica_processValueChange(ValueChangeEvent vce) {
          InicializaCampoCidade(Integer.parseInt(ufPessoaFisica.getValue().toString()));
         
    }

    public String link_AbaAnterior02_action() {
        valida.verificaCampoVazio(campoRua);
        valida.verificaCampoVazio(campoNumero);
        valida.verificaCampoVazio(campoBairro);
        valida.verificaCampoVazio(campoCep);
        
        panelTabSetCadastrarPessoaJuridica.setSelectedIndex(0);
        aba01.setDisabled(false);
        aba02.setDisabled(true);

        return null;
    }

    public String panelLayoutLogo_action() {
        //return null means stay on the same page
        return "voltar";
    }

}

